#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>

void* worker(void* arg)
{
    int id = *(int*)arg;
    printf("Hello from thread %d\n", id);
    return NULL;
}
int main()
{
    pthread_t tid;
    int arg=42;
    if(pthread_create(&tid,NULL,worker,&arg)!=0)
    {
        perror("pthread_create");
        return 1;
    }
    pthread_join(tid,NULL);
    return 0;
}